package com.example.hometown_walker.util;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;

import java.util.Date;

public class CommonUtil {

    public static void printNow() {
        System.out.println(DateFormatUtils.format(new Date(System.currentTimeMillis()),"HH:mm:ss:SSS"));
    }

    public static void timingTest() {
        CommonUtil.printNow();
        int count = 0;
        for (int i = 0; i < 99_000_000; i++) {
            int add4 = Integer.parseInt(StringUtils.split("" + (Math.random() * 100), ".")[0]);
            count += add4;

        }
        System.out.println(count);
        CommonUtil.printNow();
    }

//    public static void main(String[] args) {
//        timingTest();
//    }
}
